// 民主测评
let base = config.ip
let projectName = '/topnet-assess'
import { get, post } from './http.js'

/************************* 民主测评 *************************/

// 获取机构下民主测评的列表数据
export const listAssessmentData = (p) => get(`${base}${projectName}/sa-assessment/listAssessmentData`, p)

// 获取测评结果数据
export const listAssessmentResult = (p) => get(`${base}${projectName}/sa-assessment-result/listAssessmentResult`, p)
// 获取测评签到统计数据
export const listAssessmentSignFormVO = (p) => get(`${base}${projectName}/sa-assessment-result/listAssessmentSignFormVO`, p)
// 获取测评结果数据-组织部
export const listAssessmentResultOrgan = (p) => get(`${base}${projectName}/sa-assessment-result/listAssessmentResultOrgan`, p)
// 获取测评签到统计数据-组织部
export const listAssessmentSignFormVOOrgan = (p) => get(`${base}${projectName}/sa-assessment-result/listAssessmentSignFormVOOrgan`, p)

//开始测评
export const startAssessment = (p) => get(`${base}${projectName}/sa-assessment/skipValidation/startAssessment`, p)

// 提交测评结果
export const submitAssessment = (p) => post(`${base}${projectName}/sa-assessment/skipValidation/submitAssessment`, p)

// 获取民主测评的详情信息
export const getAssessmentDetail = (p) => get(`${base}${projectName}/sa-assessment/skipValidation/getAssessmentDetail`, p)
// 获取季度选择信息
export const listQuarterSelect = (p) => get(`${base}${projectName}/sa-assessment/listQuarterSelect`, p)
// 获取机构列表-组织部
export const listAssessmentOrgan = (p) => post(`${base}${projectName}/sa-assessment-result/listAssessmentOrgan`, p)
// 动态获取二维码
export const getSignUrl = (p) =>
  post(`${base}${projectName}/sa-assessment/getSignUrl`, p, {
    headers: {
      hideLoading: true,
    },
  })
// 获取短信验证码
export const sendSignCode = (p) => get(`${base}${projectName}/sa-assessment/skipValidation/sendSignCode`, p)
// 页面一次有效性校验-防止分享
export const signThrough = (p1, p) => get(`${base}${projectName}/sa-assessment/skipValidation/signThrough${p1}`, p)
// 签到
export const sign = (p) => post(`${base}${projectName}/sa-assessment/skipValidation/sign`, p)
// 获取机构列表-组织部
export const listUserData = (p) => post(`${base}${projectName}/sa-uias-user-status/listUserData`, p)
// export const listUserData = (p) => post(`${base}/public-uias-back/uias-user/listUserDataBody`, p);
// 特殊状态( 3退休 4调离 6离职)变更保存对应审核信息
export const userChangeStatus = (p) => post(`${base}${projectName}/sa-uias-user-status/userChangeStatus`, p)
// 发送新增、修改用户消息
export const sendUserChangeStatusMsg = (p) => post(`${base}${projectName}/sa-uias-user-status/sendUserChangeStatusMsg`, p)
// 查询用户审核状态
export const getDetail = (p) => get(`${base}${projectName}/sa-uias-user-status/getDetail`, p)
// 用户审核状态
export const updateUserStataus = (p) => post(`${base}${projectName}/sa-uias-user-status/updateUserStataus`, p)
// 获取用户被操作的日志
export const listUserOperLog = (p) => post(`${base}${projectName}/sa-uias-user-status/listUserOperLog`, p)

// 获取原来机构的职位信息
export const getInOrgPostId = ({ id, orgId }) =>
  get(`${base}${projectName}/sa-uias-user-status/getInOrgPostId`, {
    id,
    orgId,
  })
// 修改用户管理调入其他待办状态 id：待办id
export const updateOtherDeal = ({ id }) => get(`${base}${projectName}/sa-uias-user-status/updateOtherDeal`, { id })

// 获取当前部门参与测评的非公务员列表
export const getNoCivilNeedAssessByOrgId = (p) => post(`${base}${projectName}/sa-assess-final-result/getNoCivilNeedAssessByOrgId`, p)

export const getQuarterAssessPeriods = (p) => post(`${base}${projectName}/sa-assess-final-result/getQuarterAssessPeriods`, p)

// 更新民主测评审核状态
export const updateAssessmentCheckStatus = (p) => post(`${base}${projectName}/sa-assessment/updateAssessmentCheckStatus`, p)
